<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ygxx</title>
</head>
<script src="./min.js"></script>
<style>
    h1 {
        margin-left: 40px;
    }
    
    input {
        margin-bottom: 25px;
    }
    
    button {
        margin-left: 120px;
    }
</style>

<body>
    <div class="wrap">
        <h1>员工信息录入</h1>
        员工编号： <input type="text" name="Employee_id" class="employee_id"><br> 员工姓名： <input type="text" name="Employee_name" class="employee_name"><br> 员工职位： <input type="text" name="Employee_zhiwei" class="employee_zhiwei"><br> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp电话：
        <input type="text" name="phone" class="phone"><br> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp邮箱： <input type="text" name="email" class="email"><br>
    </div>

    <button class="tianjia">点击添加</button>
    <script>
        $(".luru").click(e => {
            $.ajax({
                method: "post",
                url: `${Baseurl}/Employee_info`,
                data: {
                    Employee_id: $(".employee_id").val(),
                    Employee_name: $(".employee_name").val(),
                    Employee_zhiwei: $(".employee_zhiwei").val(),
                    phone: $(".phone").val(),
                    email: $(".email").val(),
                    head_img: $(".head_img").val()
                },
                success: function(data) {
                    console.log(data);
                    if (data == "员工信息录入成功") {
                        alert(data)
                        window.location = "./index.html"
                    } else(
                        alert("录入失败")
                    )
                },
                error: function(err) {
                    console.log(err);
                }
            })
        })
    </script>
</body>

</html>